#ifndef VERTEX_H
#define VERTEX_H

namespace A48 {

class Vertex : public  Markable, public MxHeapable {
  friend class Mesh;
  friend class Patch;
  friend class Face;
  Hedge*      s_;    // star hedge

  int index;
  int index_ply;
 public:
  Point a;
  Vector3 color;

  Vertex() : a() {s_ = NULL;};

  bool is_bdry() { return s_->edge()->is_bdry(); };

  Hedge*  star_first() const { return s_; }; 

  Hedge*  star_next(Hedge* h) const {
    if (h->face() == NULL ) return NULL; // other side of boundary
    else { Hedge *n = h->next()->mate(); return (n == s_)? NULL : n; }
  }

  void set_index(int indx) {index = indx;};
  int get_index() { return index;};

  void set_index_ply(int indx_ply) {index_ply = indx_ply;};
  int get_index_ply() { return index_ply;};

 private:
  void set_star(Hedge* h) { s_ = h; }; 
};

}

#endif
